<?php

namespace App\Jobs;

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use App\Services\ApplyGoldProductReselling\ApplyGoldProductReselling;

class ApplyGoldProductResellingJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected User $user;
    protected string $pendingCacheId;

    public function __construct(User $user, $pendingCacheId)
    {
    	$this->user = $user;
    	$this->pendingCacheId = $pendingCacheId;
    }

	public function handle()
    {
	    app(ApplyGoldProductReselling::class, [
	    	'user' => $this->user,
	    	'pendingCacheId' => $this->pendingCacheId
	    ])->apply();
    }
}
